export default {
  data() {
    return {
      columns, //所有字段
      operation, //操作
      checkedColumns: columns, //选中的字段
    };
  },
  computed: {
    columnOptions() {
      let options = [];
      this.columns.forEach((column) => {
        if (column.order) {
          options.push(column.label);
        }
      });
      return options;
    },
  },
  methods: {
    // 筛选字段
    handleColumnChange(checked) {
      this.checkedColumns = this.columns.filter((column) => {
        return checked.includes(column.label) || !column.order;
      });
      this.$refs.table.doLayout();
    },
  },
};
